package com.example.design.obServerDemo;

public class MathSubjectObserver extends Observer {

  private Subject subject;

  public MathSubjectObserver(Subject subject) {
    this.subject = subject;
    this.subject.addObserver(this);
  }

  @Override
  void service() {
    System.out.println("math" + subject.getName());
  }
}
